﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
	<Style x:Key="TabControlStyle" TargetType="{x:Type TabControl}">
		<Setter Property="Template" Value="{DynamicResource TabControlControlTemplate}"/>
		<Setter Property="TabStripPlacement" Value="Left"/>
	</Style>
	<ControlTemplate x:Key="TabControlControlTemplate" TargetType="{x:Type TabControl}">
		<Grid KeyboardNavigation.TabNavigation="Local">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" MinWidth="56"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
						
			<!-- TabPanel is a layout container which allows the TabItems to wrap and re-order when selected
						The implementation knows to use this control because it is marked IsItemsHost = True -->
						
			<Border Background="{DynamicResource BrushControlBackgroundLight}" BorderBrush="{DynamicResource ImpassiveColor4}" BorderThickness="{DynamicResource ThicknessSize_1}" CornerRadius="{DynamicResource CornerRadiusSmall}" HorizontalAlignment="Stretch" Grid.Column="0" VerticalAlignment="Center">
				<UniformGrid Height="Auto" IsItemsHost="True" Columns="2" VerticalAlignment="Center"/>
						
				<!-- TabPanel is a layout container which allows the TabItems to wrap and re-order when selected
						The implementation knows to use this control because it is marked IsItemsHost = True -->
						
			</Border>
						
			<Border Grid.Row="0" x:Name="Border" Background="{DynamicResource BrushControlBackgroundLight}" BorderBrush="{DynamicResource ImpassiveColor4}" BorderThickness="{DynamicResource ThicknessSize_1}" CornerRadius="{DynamicResource CornerRadiusSmall}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="2" Grid.ColumnSpan="2" Grid.Column="1">
							
				<!-- The implementation switches the content. This control must be named PART_SelectedContentHost -->
				<ContentPresenter Margin="4" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
							
			</Border>
		</Grid>
					
		<ControlTemplate.Triggers>
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
				<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
			</Trigger>
		</ControlTemplate.Triggers>
				
	</ControlTemplate>
	<!-- Resource dictionary entries should be defined here. -->
	
	<!--Simple TabItem -->
	<Style x:Key="TabItemStyle" d:IsControlPart="True" TargetType="{x:Type TabItem}">
		<Setter Property="Template" Value="{DynamicResource TabItemControlTemplate}"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
	</Style>
	<ControlTemplate x:Key="TabItemControlTemplate" TargetType="{x:Type TabItem}">
		<Grid>
			<Border BorderThickness="3,3,3,3" BorderBrush="{x:Null}" CornerRadius="{DynamicResource CornerRadiusSmall}" Background="#FFA7BAA0" x:Name="border"/>
			<Border x:Name="Border" Background="{x:Null}" BorderBrush="{x:Null}" Margin="3,3,3,3">
				<ContentPresenter HorizontalAlignment="Center" x:Name="ContentSite" VerticalAlignment="Center" RecognizesAccessKey="True" ContentSource="Header"/>
			</Border>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ImpassiveColor4}"/>
			</Trigger>
			<Trigger Property="IsSelected" Value="True">
				<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ImpassiveColor4}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
				<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
				<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
</ResourceDictionary>